{layout name="admin:layout" /}
<div id="actionbar">
    <div class="fn-left button-group">
        <a href="{:url('system/admin.miniapp/authorizar',['types'=>0,'miniapp_id' => $miniapp_id])}" class="button{if $types == 0} button-green{/if}">正常</a>
        <a href="{:url('system/admin.miniapp/authorizar',['types'=>1,'miniapp_id' => $miniapp_id])}" class="button{if $types == 1} button-green{/if}">锁定</a>
    </div>
    <div class="fn-left">
        <form id="form" action="{:url('system/admin.miniapp/authorizar')}" method="get" class="input-group">
            <input type="hidden" name="types" value="{$types}" />
            <input type="hidden" name="miniapp_id" value="{$miniapp_id}" />
            <input placeholder="请输入用户手机号/应用名称" class="input w200" type="text" name="keyword" value="{$keyword}" />
            <input type="submit" value="搜索" class="button" />
        </form>
    </div> 
    <div class="fn-right">
        <a href="{:url('system/admin.miniapp/addAuthorizar')}" class="button button-blue"><i class="iconfont icon-add_icon"></i>创建应用</a>
    </div>
</div>
<div class="cards">
    <div class="card red">
        <div class="fn-left"><i class="iconfont icon-my_icon"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$miniapp_num}</div><div class="text">应用数量</div></div>
    </div>
    <div class="card blue">
        <div class="fn-left"><i class="iconfont icon-my_icon"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$member_miniapp_num}</div><div class="text">客户应用</div></div>
    </div>
    <div class="card yellow">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$money|money}</div><div class="text">帐号余额</div></div>
    </div>
    <div class="card yellow">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$consume|money}</div><div class="text">消费总额</div></div>
    </div>
</div>
<table class="table table-border">
<thead>
    <tr>
        <th class="fn-tac w50">#</th>
        <th class="w120">手机号</th>
        <th class="w80"></th>
        <th>应用名称</th>
        <th>客户端ID</th>
        <th class="w100 fn-tac">应用类型</th>
        <th class="w70 fn-tac">状态</th>
        <th class="w160">创建时间</th>
        <th class="w80 fn-tac">管理</th>
    </tr>
</thead>
<tbody>
{foreach $apps as $rs}
    <tr>
        <th class="fn-tac">{$rs->id}</th>
        <td><a href="{:url('system/admin.miniapp/authorizar',['keyword' => $rs.member.phone_id])}">{$rs.member.phone_id}</a></td>
        <td class="fn-tac"><a href="{:url('system/admin.member/manage',['id' => $rs->id])}"  target="_blank"><img class="w60" src="{$rs.logo}" style="border-radius: 10px;"></a></td>
        <td><a href="{:url('system/admin.member/manage',['id' => $rs->id])}"  target="_blank">{$rs.appname}</a></td>
        <td>{$rs.service_id}</td>
        <td class="fn-tac">
            {switch $rs.miniapp.types}
            {case mp}<svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号{/case}
            {case program}<svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序{/case}
            {case app}APP{/case}
            {case mp_program}
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号{/case}
            {case mp_program_app}
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-yingyongyuanma"></use></svg> 轻应用
            {/case}
            {default /}<span class="badge">应用异常</span>
            {/switch}  
        </td>
        <td class="fn-tac">
            <a class="isLock" url="{:url('system/admin.miniapp/islockAuthorizar',array('id'=>$rs.id))}" href="javascript:;" title="锁定/解锁">
            {if $rs.is_lock}
                <span class="badge bg-red">锁定</span>
            {else}
                <span class="badge">正常</span>
            {/if}
            </a>
        </td>
        <td>{$rs.create_time|date='Y-m-d H:i'}</td>
        <td class="fn-tac">
            <a class="button" href="{:url('system/admin.miniapp/editAuthorizar',['id'=>$rs->id])}"><i class="iconfont icon-edit"></i>设置</a>
        </td> 
    </tr>
{/foreach}
</tbody>
</table>
{$list|raw}
<script type="text/javascript">
Do('base','layer',function(){
    $('.isDel').isDel();
    $('.isLock').actUrl();
})
</script>